package com.obas.access.business.service.impl;

import com.ease.common.vo.MapParameter;
import com.ease.platform.access.service.impl.AbstractParameterizedBeanIbatisAccessServiceImpl;
import com.obas.access.business.service.PortAccessService;
import com.obas.model.business.Port;

public class PortAccessServiceImpl extends AbstractParameterizedBeanIbatisAccessServiceImpl<Port> implements PortAccessService {

	public Port findByDeviceIdSlotIdSubSlotIdAndCode(long deviceId, long slotId, long subslotId, String code) {
		MapParameter parameter = new MapParameter();
		parameter.put(Port.Attribute_deviceId, deviceId);
		if (slotId > 0) {
			parameter.put(Port.Attribute_slotId, slotId);
		}
		if (subslotId > 0) {
			parameter.put(Port.Attribute_subslotId, subslotId);
		}
		parameter.put(Port.Attribute_code, code);
		return this.findOne(parameter);
	}

}
